<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form id="app">
        姓名:<input type="text" v-model="uname"><br>
        性别：<input type="radio" name="sex" id="" value="1" v-model="gender">男 
            <input type="radio" name="sex" id="" value="2" v-model="gender">女 <br>
        爱好：<input type="checkbox" name="hobbies" id="" value="1" v-model="hobby">篮球 
        <input type="checkbox" name="hobbies" id="" value="2" v-model="hobby">唱歌 
        <input type="checkbox" name="hobbies" id="" value="3" v-model="hobby">写代码<br>
        <!-- muriple多选 -->
        职业：<select name="profession" id="" v-model="occupation" multiple="true" title="按住shift键多选">
            <option value="0">请选择职业...</option>
            <option value="1">教师</option>
            <option value="2">工人</option>
            <option value="3">医生</option>
        </select><br>
        个人简介： <textarea name="" id="" cols="30" rows="10" v-model='dec'></textarea><br>
        <input type="submit" value="提交" @click.prevent = 'handle'>
    </form>
    
    
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el:'#app',
            data() {
                return {
                    uname:'',
                    gender:2,
                    hobby:[1,3],
                    // 多选是数组
                    occupation:[2,3],
                    dec:'你好'
                }
            },
            methods: {
                handle:function(){
                    console.log(this.uname)
                }
            },
        })
    </script>
</body>
</html>